﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title>宾果高校</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/bootstrap-datetimepicker.min.css" />
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/sweetalert.min.css" />
    <script src="../js/jquery-1.12.2.min.js"></script>
    <script src="../js/common.js"></script>
    <script src="../js/angular.min.js"></script>
    <script src="../js/bootstrap-datetimepicker.js"></script>
    <script src="../js/bootstrap-datetimepicker.zh-CN.js"></script>
    <script src="../js/sweetalert.min.js"></script>
</head>
<body id="bodyContent">
    <div id="searchPage"></div>
    <div class="main">
        <div class="wrap">
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="form-wrap">
                        <form id="formValidate" action="" class="form-horizontal">
                            <div class="form-group" id="divArea">
                                <label for="" class="radio-inline">活动地区：</label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value=""><span>不限</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300000"><span>广州市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300001"><span>汕头市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300002"><span>湛江市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300003"><span>潮州市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300004"><span>茂名市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300005"><span>深圳市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300006"><span>韶关市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300007"><span>梅州市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300008"><span>惠州市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300009"><span>东莞市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300010"><span>江门市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300011"><span>佛山市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300012"><span>肇庆市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300013"><span>珠海市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300014"><span>中山市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300015"><span>河源市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300016"><span>汕尾市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300017"><span>阳江市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300018"><span>清远市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300019"><span>揭阳市</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="MoneyName" value="300020"><span>云浮市</span>
                                </label>
                            </div>
                            <div class="form-group" id="divCount">
                                <label for="" class="radio-inline">活动涉及学生总数:</label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="LikedCount" value="900000003"><span>0-100</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="LikedCount" value="900000004"><span>101-300</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="LikedCount" value="900000005"><span>301-500</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="LikedCount" value="900000006"><span>501-1000</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="LikedCount" value="900000007"><span>1001-1500</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="LikedCount" value="900000008"><span>1501-2500</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="LikedCount" value="900000009"><span>2501-3000</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="LikedCount" value="900000010"><span>3000以上</span>
                                </label>
                            </div>
                            <div class="form-group" id="divType">
                                <label for="" class="checkbox-inline">活动类型：</label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="EntrantsName" value="900000040"><span>招新类</span>
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="EntrantsName" value="900000041"><span>文艺类</span>
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="EntrantsName" value="900000042"><span>表演类</span>
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="EntrantsName" value="900000043"><span>晚会类</span>
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="EntrantsName" value="900000044"><span>体育类</span>
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="EntrantsName" value="900000045"><span>讲座类</span>
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="EntrantsName" value="900000046"><span>比赛类</span>
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="EntrantsName" value="900000047"><span>其它</span>
                                </label>
                            </div>
                            <div class="form-group form-inline">
                                <label for="" class="radio-inline">活动时间:</label>
                                <input type="text" id="StartTime" style="display: inline-block; width: 110px;" placeholder="" data-error="请填写时间" required class="form-control input-sm datepick"><span> -</span>
                                <input type="text" id="EndTime" style="display: inline-block; width: 110px;" placeholder="" data-error="请填写时间" required class="form-control input-sm datepick">
                                <div class="help-block with-errors"></div>
                                <button type="button" class="btn btn-default" style="display: inline-block;" onclick="Go()">提交</button>
                            </div>
                            <div class="form-group" id="divMoney">
                                <label for="" class="radio-inline">企业提供赞助金额：</label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Money" value="900000011"><span>500-2500</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Money" value="900000012"><span>2501-5000</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Money" value="900000013"><span>5001-7500</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Money" value="900000014"><span>7501-10000</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Money" value="900000015"><span>10001-15000</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Money" value="900000016"><span>15001-20000</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Money" value="900000017"><span>20001-25000</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Money" value="900000018"><span>25001-30000</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Money" value="900000019"><span>30001-50000</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Money" value="900000020"><span>50001-70000</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Money" value="900000021"><span>70001-100000</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Money" value="900000022"><span>100001-150000</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Money" value="900000023"><span>150001-200000</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Money" value="900000024"><span>200000以上</span>
                                </label>
                            </div>
                        </form>
                    </div>
                    <hr>
                    <div ng-app="myApp3">
                        <table ng-controller="companyProjectCtrl" class="table table-hover">
                            <tr>
                                <td>企业赞助书名称</td>
                                <td>所属公司名称</td>
                                <td>活动地区（省-市）</td>
                                <td>活动类型</td>
                                <td>赞助提供金额</td>
                                <td>赞助发布时间</td>
                            </tr>
                            <tr ng-repeat="x in names">
                                <td> <a href="sponsor-detail.html?id={{x.ProjectNO}}">{{x.ProjectName}}</a></td>
                                <td>{{x.Company.CompanyName}}</td>
                                <td><span ng-repeat="y in x.City">{{y}}&nbsp;</span></td>
                                <td><span ng-repeat="y in x.Type">{{y}}&nbsp;</span></td>
                                <td>{{x.Money}}</td>
                                <td>{{x.CreateTime | date:'yyyy-MM-dd'}}</td>
                            </tr>
                            <!--<tr>
                                <td> <a href="enterprise-sponsor-detail.html">百事公司大学生演唱会</a></td>
                                <td>百事可乐公司</td>
                                <td>广东省-深圳市</td>
                                <td>文艺类</td>
                                <td>10000.0</td>
                                <td>2016-08-07</td>
                            </tr>-->
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script>

    $("#searchPage").load("header.html", function () {
        SetCss("Spon");
    });

    $(function () {
        $('.datepick').datetimepicker({
            format: 'yyyy-mm-dd',
            language: 'zh-CN',
            minView: 2
        });
    });

    var param = common.getUrlArgStr();
    if (param.type != undefined) {
        switch (param.type) {
            case "money":
                $("#divMoney [value='" + param.id + "']").attr('checked', true);
                break;
            case "nature":
                $("#divType [value='" + param.id + "']").attr('checked', true);
                break;
            case "area":
                $("#divArea [value='" + param.id + "']").attr('checked', true);
                break;
        }
    }


    var app = angular.module('myApp3', []);

    app.controller('companyProjectCtrl', function ($http, $scope) {
        $scope.update = function (data) {
            $scope.names = data;
            $scope.$apply();
        }
    });

    function AfteAjax(ctx) {
        if (ctx == null) {
            alert("无数据.");
            return;
        }

        var ele = document.querySelector("[ng-controller=companyProjectCtrl]");

        angular.element(ele).scope().update(ctx.ResponseList);
    }

    function Go() {

        var values = common.GetCtrlValues({
            ContentID: "formValidate"
        })

        common.commonAjax({ type: 'Post', url: '../api/project/PostListActivity', data: values, sMethod: AfteAjax, loadingCtrl: $("#bodyContent") });
    }

    $(document).ready(function () {

        Go();

        $("#divArea [name='MoneyName']").each(function () {
            $(this).click(function () {
                Go();
            })
        });

        $("#divCount [name='LikedCount']").each(function () {
            $(this).click(function () {
                Go();
            })
        });

        $("#divType [name='EntrantsName']").each(function () {
            $(this).change(function () {
                Go();
            })
        });

        $("#divMoney [name='Money']").each(function () {
            $(this).click(function () {
                Go();
            })
        });
    })
</script>